#ifndef F28P65X_HRPWMCAL_H
#define F28P65X_HRPWMCAL_H

#ifdef __cplusplus
extern "C" {
#endif

//---------------------------------------------------------------------------
// HRPWMCAL Individual Register Bit Definitions:

struct HRPWR_BITS
{                        // bits description
    Uint16 rsvd1    : 2; // 1:0 Reserved
    Uint16 rsvd2    : 1; // 2 Reserved
    Uint16 rsvd3    : 1; // 3 Reserved
    Uint16 rsvd4    : 1; // 4 Reserved
    Uint16 rsvd5    : 1; // 5 Reserved
    Uint16 rsvd6    : 4; // 9:6 Reserved
    Uint16 rsvd7    : 5; // 14:10 Reserved
    Uint16 CALPWRON : 1; // 15 Calibration Power On
};

union HRPWR_REG
{
    Uint16 all;
    struct HRPWR_BITS bit;
};

struct HRMSTEP_BITS
{                       // bits description
    Uint16 HRMSTEP : 8; // 7:0 High Resolution Micro Step Value
    Uint16 rsvd1   : 8; // 15:8 Reserved
};

union HRMSTEP_REG
{
    Uint16 all;
    struct HRMSTEP_BITS bit;
};

struct HRCTRL_BITS
{                             // bits description
    Uint16 rsvd1        : 12; // 11:0 Reserved
    Uint16 CAL_DONE     : 1;  // 12
    Uint16 SAMPLE_VALID : 1;  // 13
    Uint16 SAMPLE_EN    : 1;  // 14
    Uint16 CAL_EN       : 1;  // 15
};

union HRCTRL_REG
{
    Uint16 all;
    struct HRCTRL_BITS bit;
};

struct HRPWMCAL_REGS
{
    Uint32 rsvd1[16];          // Reserved
    Uint16 rsvd2;              // Reserved
    union HRPWR_REG HRPWR;     // HRPWM Power Register
    Uint16 rsvd3[4];           // Reserved
    union HRMSTEP_REG HRMSTEP; // HRPWM MEP Step Register
    union HRCTRL_REG HRCTRL;   // HRPWM Control Register
};

//---------------------------------------------------------------------------
// HRPWMCAL External References & Function Declarations:
//
extern volatile struct HRPWMCAL_REGS HRPWMCAL1Regs;
extern volatile struct HRPWMCAL_REGS HRPWMCAL2Regs;
extern volatile struct HRPWMCAL_REGS HRPWMCAL3Regs;

extern volatile struct HRPWMCAL_REGS HHRPWMCAL1Regs;
extern volatile struct HRPWMCAL_REGS HHRPWMCAL2Regs;
extern volatile struct HRPWMCAL_REGS HHRPWMCAL3Regs;

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif

//===========================================================================
// End of file.
//===========================================================================
